home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cchh01.arc / XMODEM.H < prev   
Text File  |  1986-03-14  |  3KB  |  81 lines

  1. /*---------------------------------------------------------------
  2.                            XMODEM.C
  3.                           Header File
  4.             (c) Copyright 1985 by Donald G Krantz
  5.                      All Rights Reserved
  6. ---------------------------------------------------------------*/
  7.  
  8. #ifdef MAIN
  9. #define MODE /* global */
  10. #else
  11. #define MODE extern
  12. #endif
  13.  
  14. /*---------------------------------------------------------------
  15. ASCII and XMODEM control characters
  16. ---------------------------------------------------------------*/
  17.  
  18. #define SOH 1            /* start of header        */
  19. #define EOT 4            /* end of transmission        */
  20. #define ACK 6            /* true acknowledge        */
  21. #define NAK 0x15        /* false acknowledge        */
  22. #define CRC 'C'            /* request CRC mode        */
  23. #define CAN 0x18        /* cancel transmission        */
  24. #define EoF 26            /* end of file (used for name)    */
  25. #define BADNAME 0x75        /* received bad name checksum    */
  26.  
  27. /*---------------------------------------------------------------
  28. User accessable system equates
  29. ---------------------------------------------------------------*/
  30.  
  31. #define RETRY        25        /* no. of retrys before abort    */
  32. #define RECSIZE      128    /* transfer record size        */
  33. #define NAMESIZE     11        /* filename fixed length     */ 
  34. #define ERROR        -1
  35. #define MAGIC_NUMBER 10000    /* time constant - machine dep.    */
  36. #define VOID         int    /* function type        */
  37. #define UPLOG        "A:UPLOAD.LOG"
  38. #define DOWNLOG      "A:DOWNLOAD.LOG"
  39. #define LOG_ON       TRUE
  40.  
  41. /*---------------------------------------------------------------
  42. Global variables
  43. ---------------------------------------------------------------*/
  44.  
  45. MODE int option_speced;        /* any options listed flag    */
  46. MODE int t_r_mode;        /* tx or rec requested flag    */
  47. MODE int batch_request;        /* batch mode requested    flag    */
  48. MODE int crc;            /* CRC mode flag        */
  49. MODE char msg[ 80 ];        /* message passing string    */
  50. MODE FILE *fd;            /* main file pointer        */
  51. MODE char rx_spec[ 20 ];    /* rx filespec preamble        */
  52. MODE char scr_name[ 50 ];    /* temporary string        */
  53. MODE char buffer[ RECSIZE ];    /* record buffer        */
  54. MODE unsigned rec;        /* record number        */
  55. MODE char checksum;        /* checksum accumulator        */
  56. MODE unsigned crcaccum;        /* global crc bytes        */
  57.  
  58. /*----------------------------------------------------------------
  59. Function type declarations
  60. ----------------------------------------------------------------*/
  61.  
  62. VOID txfile(), txname(), txrec(), parsopt(), do_usage();
  63. VOID rxname(), rxfile(), error(), clrcrc(), show_size();
  64. VOID lcl_str(), main(), lcl_char(), make_rxspec();
  65. VOID updcrc(), abort(), sleep(), tx();
  66. char *index(), *parse(), *unparse(), rx();
  67. int fillbuf(), wait(), rxstat(), txstat();
  68. FILE *make(), *fopen();
  69. long fseek();
  70.  
  71. #if LOG_ON
  72.    VOID log_xfr();
  73.    int month(), day(), year();
  74. #endif
  75. , txstat();
  76. FILE *make(), *fopen();
  77. long fseek();
  78.  
  79. #if LOG_ON
  80.    VOID log_xfr();
  81.    int month(), day(), yea